// BlockOperation.h: interface for the BlockOperation class.
//
//////////////////////////////////////////////////////////////////////

#if !defined(AFX_BLOCKOPERATION_H__6FA89245_71C0_438B_A30A_15543E6FDC55__INCLUDED_)
#define AFX_BLOCKOPERATION_H__6FA89245_71C0_438B_A30A_15543E6FDC55__INCLUDED_

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000

class AcDbLayerTableRecord;

class AFX_EXT_CLASS BlockOperation  
{
public:
	BlockOperation();
	virtual ~BlockOperation();

public:
	static Acad::ErrorStatus InsertBlock(const CString& strBlock,
		const AcGeMatrix3d& matrix, AcDbObjectId& id, 
		const CString& strLayer = CString(),
		AcDbDatabase* pDB = NULL);

private:
	static Acad::ErrorStatus InsertBlock(const CString& strBlock, AcDbDatabase* pDB, AcDbObjectId& id);
	static CString GetBlockName(const CString& strBlock);
	static BOOL FindBlock(AcDbDatabase* pDB, const CString& strBlockName, AcDbObjectId& id);
	static Acad::ErrorStatus AddNewBlock(AcDbDatabase* pDB, const CString& strBlock, const CString& strBlockName, AcDbObjectId& id);
};

namespace LayerOperation
{
	DllExport Acad::ErrorStatus AddLayer(const CString& strName,
										 AcDbObjectId& id,
										 AcDbDatabase* pDB = NULL);
	DllExport AcDbLayerTableRecord* GetLayer(const CString& strName, AcDbDatabase* pDB = NULL);
	DllExport void FrozenLayer(const CString& strName, BOOL IsFrozen, AcDbDatabase* pDB = NULL);
}
#endif // !defined(AFX_BLOCKOPERATION_H__6FA89245_71C0_438B_A30A_15543E6FDC55__INCLUDED_)
